﻿//------------------------------------------------------------------------------
// <pcdd-entitiy>
//     代理业务类库
//     点位业务对象
// </pcdd-entitiy>
//------------------------------------------------------------------------------

using System.Collections.Generic;
using CL.Business.DAL;
using CL.Business.Entity;
using CL.Enum.Common;
using CL.View.Entity.Business;

namespace CL.Business.BLL
{
    /// <summary>
    /// RebateBLL 业务
    /// </summary>
    public class RebateBLL
    {
        RebateDAL dal = new RebateDAL(DbConnectionEnum.CaileBusiness);

        /// <summary>
        /// 查询对象集合
        /// </summary>
        /// <param name="UnionID"></param>
        /// <returns></returns>
        public List<RebateEntity> QueryEntitys(int AccountID)
        {
            return dal.QueryEntitys(AccountID);
        }
        /// <summary>
        /// 查询单个对象
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public RebateEntity QueryEntity(int ID)
        {
            return dal.QueryEntity(ID);
        }
        /// <summary>
        /// 新增对象
        /// </summary>
        /// <param name="Entity"></param>
        /// <returns></returns>
        public int InsertEntity(RebateEntity Entity)
        {
            return dal.InsertEntity(Entity);
        }
        /// <summary>
        /// 更新对象
        /// </summary>
        /// <param name="Entity"></param>
        /// <returns></returns>
        public int ModifyEntity(RebateEntity Entity)
        {
            return dal.ModifyEntity(Entity);
        }

        /// <summary>
        /// 返点设置数据是否存在
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool Exists(int id)
        {
            return dal.Exists(id);
        }

        /// <summary>
        ///  推广代理返点设置数据是否存在  
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool AccountExists(int id,long amount)
        {
            return dal.AccountExists(id, amount);
        }





        /// <summary>
        /// 删除对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool DelEntity(int id)
        {
            return dal.DelEntity(id);
        }

        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public List<udv_CommissionRebateViewModel> QueryListByPage(int pageSize, int pageIndex, string searchKey, ref int recordCount)
        {
            return dal.QueryListByPage(pageSize, pageIndex, searchKey, ref recordCount);
        }

    }
}
